package org.visionlibrary.image.geomtric.model;


import org.visionlibrary.image.geomtric.util.Debug;

public class TRightTriangle extends TShape {
	
	private TRightTriangle(String name) {
		super(name);
	}

	public TRightTriangle(String name, Point2d origin, double width,
			double height) {
		super(name);
		segments.add(new Vector2d(origin, new Point2d(origin.x, origin.y
				+ height)));
		segments.add(new Vector2d(origin, new Point2d(origin.x + width,
				origin.y)));
		segments.add(new Vector2d(new Point2d(origin.x, origin.y + height),
				new Point2d(origin.x + width, origin.y)));
	}

	@Override
	public TShape copy(String name) {
		TRightTriangle tcopy = new TRightTriangle(name);
		tcopy.segments = org.visionlibrary.image.geomtric.lines.Lines.copy(segments);
		return tcopy;
	}

	public String toString() {
		return Debug.Misc.getClassName(this.getClass()) + "("
				+ super.toString() + ");";
	}
}